package matchesexercise;

import java.util.Arrays;

public class SplitDemo {
    public static void main(String[] args) {
        String line="abc123def456ghi";
        String[] data=line.split("[0-9]+");
        for (int i=0;i<data.length;i++){
            System.out.println(data[i]);
        }

        String line1="123.45.789";
        data=line1.split("[\\.]");//按.分割，.就没了
        System.out.println(Arrays.toString(data));//把data类型转换为数组

        line=".123..456....789....";
        data=line.split("[\\.]");
        System.out.println(Arrays.toString(data));
        System.out.println(data.length);//7
    }
}
